//
//  SLAboutViewController.m
//  SoccerLottery
//
//  Created by chuanshuangzhang chuan shuang on 15/12/24.
//  Copyright © 2015年 chuanshuangzhang. All rights reserved.
//

#import "SLAboutViewController.h"

@interface SLAboutViewController ()

@property (weak, nonatomic) IBOutlet UILabel *versionLabel;
@property (weak, nonatomic) IBOutlet UILabel *copyrightLabel;
@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end

@implementation SLAboutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setTitle:@"关于" back:YES];
    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
    [formatter setDateFormat:@"yyyy"];
    
    NSString *currentDateStr = [formatter stringFromDate:[NSDate date]];
    if([currentDateStr integerValue]>2015){
        self.copyrightLabel.text = [NSString stringWithFormat:@"Copyright ©2015-%@",currentDateStr];
    }else {
        self.copyrightLabel.text = [NSString stringWithFormat:@"Copyright ©%@",currentDateStr];
    }
    self.versionLabel.text = [NSString stringWithFormat:@"竞彩王 v%@",[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]];
    
    NSString *url = @"<div style=\"white-space:normal;padding:0px;margin:0px;line-height:24px;color:#252525;font-family:Simsun;font-size:14px;\">\n\t竞彩王手机客户端是专为彩民和球迷打造的便捷通道，帮助彩民和球迷获取比赛信息，选择比赛以及查看比赛结果的有力工具；提供全方位的数据信息，是提高竞彩中奖率的必备工具。\n</div>";
    [_webView loadHTMLString:url baseURL:nil];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
